<script src="/res/editor/js/webeditor.js" tppe="text/javascript"></script>
<script src="/js/cartoon.js" tppe="text/javascript"></script>
<form>
<table class="mlist"  cellpadding="0" width="50%" cellspacing="0" style="float: left">
	<thead align="center">
		<td nowrap>卷id</td>
		<td nowrap>卷名称</td>
		<td nowrap>图片数量</td>
		<td nowrap>章节排序</td>
		<td nowrap>创建时间</td>
		<td nowrap>操作</td>
	</thead>
	<? foreach ($this->ret['data'] as $row):?>
	<tr align="left">
		<td nowrap><?= $row['id']?></td>
		<td nowrap><span id='title_<?=$row['id']?>'><?= $row['chapter_title']?></span></td>
		<td nowrap><span ><?= $row['pic_num']?></span></td>
		<td>
		<span id="order_<?=$row['id']?>"><?=$row['order_num']?></span>
		<input type="hidden" value="<?=$row['info']?>" id="desc_<?=$row['id']?>" />
		</td>
		<td>
		<?=date('Y-m-d H:i',$row['add_time'])?>
		</td>
		<td nowrap align="left">
		<a href="<?=$this->_makeURL($this->app, $this->controller, 'batch_photo_form', array('chapter_id'=>$row['id']))?>">上传图片</a>
		<a href="javascript:void(0);" onclick="Cartoon.delChapter(<?= $row['id']?>);">删除</a>
		</td>
	</tr>
	<? endforeach;?>
	<thead>
	<td colspan="8"><?=$this->ret['pages']?></td>
	</thead>
</table>
</form>
<div style="float:left; padding-left: 10px">

</div>
<table class="mlist"  cellpadding="0" width="50%" cellspacing="0" style="float: left">
	<thead align="center">
		<td nowrap colspan="2">创建章节</td>
	</thead>
	<tr align="left">
		<td nowrap>章节名：</td>
		<td nowrap><input class="input_text"  type="text" name="chapter_title"  size="25" />
		<input type="hidden" value="<?=$this->ret['cartoon_info']['id']?>"  id = "_cartoon_id" />
	</td>
	</tr>
	<tr align="left">
		<td nowrap>章节排序：</td>
		<td nowrap>
		<input class="input_text"  type="text" name="chapter_ordernum"  size="25" value="0" />
		</td>
	</tr>
	<tr align="left">
		<td nowrap>章节描述：</td>
		<td nowrap>
		<input type="hidden" id="s_desc" name="s_desc" />
	<div id="postcontent">
		<textarea id="simple_desc" name="simple_desc" ></textarea>
	</div>
	<script type="text/javascript">
	var e_fontsize = true;
	var e_face = true;
	var e_media = false;
	var e_bold = true;
	var e_InsertOrderedList = true;
	var e_italic = true;
	var e_underline = true;
	var e_JustifyLeft = true;
	var e_JustifyCenter = true;
	var e_JustifyRight = true;
	var e_font = true;
	var e_color = true;
	var e_backcolor = false;
	var e_img = true;
	var e_link = true;
	var e_uploadimg = false;
	var e_piclink = false;
	var e_CommentFace = false;
	var e_face = false;
	var e_toolbarbg = true;
	s_content_editor = new webEditor("s_content_editor" , 	$("postcontent"),500,200);
	s_content_editor.init($('simple_desc').value);
</script>
		</td>
	</tr>
	<thead>
	<td colspan="2" align="center"><input type="button" id="btn_addChapter" onclick="Cartoon.addChapter()" value="添加" /></td>
	</thead>
</table>
<script>
hookDeleteConfirm.hook = function(src){ return $H({_app: 'cartoon', _controller: 'index', _action: 'remove_chapter', id: src.getAttribute('id')}).toQueryString();};
</script>